package com.ceres.farm.dao;

import com.ceres.farm.pojo.History;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface HistoryMapper extends Mapper<History> {
    //根据大田ID查询历史数据表
    @Select("select * from t_history where fid=#{id}")
    List<History> findAllByFid(Integer fid);
    @Insert("INSERT INTO t_history(`fid`, `cname`, `start_time`, `end_time`, `dnumber`, `output`, `remarks`, `lose`) VALUES (#{fid}, #{cname},#{startTime}, #{endTime}, #{dnumber}, #{output}, #{remarks}, #{lose})")
    void insertHistory(History history);
}
